Similar questions

Recipe 9.5 Group fields in a form

Sample:

Billing details
Shipping details

Code:

<fieldset>
  <legend>Billing details</legend>

  <div>
    <label for="billing_name">Name</label>
    <input type="text" id="billing_name" name="billing_name">
  </div>

  <div>
    <label for="billing_address">Address</label>
    <input type="text" id="billing_address" name="billing_address">
  </div>
</fieldset>

<fieldset>
  <legend>Shipping details</legend>

  <div>
    <label for="shipping_name">Name</label>
    <input type="text" id="shipping_name" name="shipping_name">
  </div>
  
  <div>
    <label for="shipping_address">Address</label>
    <input type="text" id="shipping_address" name="shipping_address">
  </div>
</fieldset>